<?php 
abstract  class Myhelper_Utils_Library{
	
 
	
    public  function toOptions(array $Array,array $StaticOption=array(),array $config=array()){
		
    	
    	if(count($StaticOption)>0){
    		$options =  "<option value='".$StaticOption['key']."'>".$StaticOption['value']."</option>";
    	}else{
    		$options ="";
    	}
		
		
		foreach($Array as $key => $value){
			if(is_array($value) && !isset($value['key'])){
				$options.=  "<optgroup label='".$key."'>";
				foreach($value as $keyvalue => $valofvalue){
					$options.=  "<option value='".$valofvalue['key']."'>".$valofvalue['value']."</option>";
				}
				$options.=  "</optgroup>";
			}else{
				$options.=  "<option value='".$value['key']."'>".$value['value']."</option>";
			}
			
		}
		return $options;
		
	}
	
	 
	
}